/*
 * @Author: lyx 2858535420@qq.com
 * @Date: 2023-02-28 17:21:09
 * @LastEditors: lyx 2858535420@qq.com
 * @LastEditTime: 2023-04-28 14:25:35
 * @FilePath: /antd-vue2-template/src/mixins/app-mixin.js
 * @Description: 默认设置
 */
import { mapState } from 'vuex';

const baseMixin = {
  computed: {
    ...mapState({
      layoutMode: state => state.app.layout,
      navTheme: state => state.app.theme,
      // 主题配置信息
      themeConfig: state => state.app.themeConfig,
      primaryColor: state => state.app.color,
      colorWeak: state => state.app.weak,
      fixedHeader: state => state.app.fixedHeader,
      fixedSidebar: state => state.app.fixedSidebar,
      contentWidth: state => state.app.contentWidth,
      autoHideHeader: state => state.app.autoHideHeader,

      isMobile: state => state.app.isMobile,
      sideCollapsed: state => state.app.sideCollapsed,
      // 多页签
      multiTab: state => state.app.multiTab,
      // 面包屑
      showBreadCrumb: state => state.app.showBreadCrumb,
      // 菜单伸缩位置
      menuTriggerMode: state => state.app.menuTrigger
    }),
    isTopMenu() {
      return this.layout === 'topmenu';
    }
  },
  methods: {
    isSideMenu() {
      return !this.isTopMenu;
    }
  }
};

export {
  baseMixin
};
